<template>
    <div class="inner">
      <div class="tabs">
        <a href="javascript:;" @click="bright(0)" :class="{  active:num == 0 }">●加速度</a>
        <a href="javascript:;" @click="bright(1)" :class="{  active:num == 1 }">●挠度</a>
      </div>
      <div class="content" v-if="num==0">
        <div class="head">
          <span class="col">所处位置</span>
          <span class="col">传感器编号</span>
          <span class="col">值(g)</span>
        </div>
        <div class="marquee-view">
          <div class="marquee">
            <div class="row" v-for="(item,index) in speed1"
            :key="index">
              <span class="col">{{ item.place }}</span>
              <span class="col">{{ item.sid }}</span>
              <span class="col">{{ item.value }}</span>
            </div>
          </div>
        </div>
      </div>
      <div class="content" v-if="num==1">
        <div class="head">
          <span class="col">所处位置</span>
          <span class="col">传感器编号</span>
          <span class="col">值(mm)</span>
        </div>
        <div class="marquee-view">
          <div class="marquee">
            <div class="row" v-for="(item,index) in deflection"
            :key="index">
              <span class="col">{{ item.place }}</span>
              <span class="col">{{ item.sid }}</span>
              <span class="col">{{ item.value }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  data(){
    return{
      active:'active',
      num:0
    }
  },
  // vuex数据引入
  computed:{
    ...mapState([
    'speed1',
    'deflection'
    ])
  },
  methods:{
    bright(a){
      this.num=a
    },

  },
}
</script>
<style>
</style>